Skip to content

feat(integration): add status reporting#2674

Open
PascalThuet wants to merge 11 commits into
github:mainfrom
PascalThuet:codex/integration-doctor
Open

feat(integration): add status reporting#2674
PascalThuet wants to merge 11 commits into
github:mainfrom
PascalThuet:codex/integration-doctor

Conversation

@PascalThuet
Copy link
Copy Markdown
Contributor

@PascalThuet PascalThuet commented May 22, 2026

Summary

  • add specify integration status for read-only integration status reporting
  • report default/installed integrations, multi-install safety, manifest health, and missing/modified managed files
  • document the command and cover healthy/unhealthy status cases

Closes #2671

Maintainer feedback

Review feedback

  • Removed the private manifest hash helper import by hashing locally in the status module.
  • Reused a single integration.json read for raw and normalized state.
  • Avoided repeated project-root resolution during manifest file checks.
  • Added JSON coverage for warning/error status branches.
  • Documented exit-code semantics for CI/agent consumers.
  • Rejected unsafe integration keys before constructing manifest paths.
  • Escaped project-controlled values before rendering Rich status output.
  • Rejected filename-invalid and Windows-reserved manifest keys.
  • Kept reported installed integrations aligned with the raw state used for manifest checks.
  • Replaced managed-file exists() prechecks with explicit lstat/stat handling.
  • Avoided impossible integration upgrade <unknown> suggestions for stale unknown integrations.
  • Clarified raw recorded vs effective installed integrations in JSON status output.
  • Kept manifest checks on the effective default when the raw installed list is empty.
  • Documented the raw integration-state reader contract.
  • Reused initialized status-test project templates to avoid rerunning full init for each status case.

Testing

  • uv run --extra test pytest tests/integrations/test_integration_subcommand.py::TestIntegrationStatus -q - 28 passed
  • uv run --extra test pytest tests/integrations/test_integration_subcommand.py tests/integrations/test_manifest.py -q - 116 passed
  • uvx ruff check src/specify_cli/integration_state.py src/specify_cli/integration_status.py src/specify_cli/__init__.py tests/integrations/test_integration_subcommand.py tests/integrations/test_manifest.py
  • git diff --check

AI Disclosure

  • I did not use AI assistance
  • I did use AI assistance

Used OpenAI Codex to inspect the integration state/manifest helpers, implement the status reporting command, add tests/docs, address maintainer and review feedback, run validation, and draft this PR.

Copilot AI review requested due to automatic review settings May 22, 2026 07:20
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a new specify integration doctor subcommand to provide read-only diagnostics of a project’s integration state, with both human-readable and JSON outputs.

Changes:

  • Introduces integration_doctor.py to compute a structured health report (findings, manifest checks, multi-install safety).
  • Adds CLI wiring + formatted console/JSON output for specify integration doctor.
  • Adds integration tests and reference docs for the new command.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
tests/integrations/test_integration_subcommand.py Adds integration tests covering integration doctor success and failure modes.
src/specify_cli/integration_doctor.py Implements the diagnostic report generation and manifest/state validation logic.
src/specify_cli/init.py Adds the integration doctor Typer command and report printing/JSON emission.
docs/reference/integrations.md Documents usage and expected outputs for integration doctor.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/integrations/test_integration_subcommand.py Outdated
Comment thread src/specify_cli/integration_doctor.py Outdated
Comment thread src/specify_cli/integration_status.py
Comment thread src/specify_cli/integration_status.py Outdated
Comment thread src/specify_cli/integration_status.py
@PascalThuet PascalThuet marked this pull request as ready for review May 22, 2026 08:14
@PascalThuet PascalThuet requested a review from mnriem as a code owner May 22, 2026 08:14
Copilot AI review requested due to automatic review settings May 22, 2026 08:14
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

Comment thread src/specify_cli/integration_status.py
Comment thread src/specify_cli/integration_status.py Outdated
Comment thread src/specify_cli/integration_doctor.py Outdated
Copilot AI review requested due to automatic review settings May 26, 2026 15:47
@PascalThuet PascalThuet changed the title feat(integration): add doctor diagnostics feat(integration): add status reporting May 26, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

Comment thread src/specify_cli/integration_status.py Outdated
Comment thread src/specify_cli/integration_status.py Outdated
Comment thread src/specify_cli/integration_status.py Outdated
Comment thread src/specify_cli/integration_status.py Outdated
Comment thread docs/reference/integrations.md
Copilot AI review requested due to automatic review settings May 26, 2026 16:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Comment thread src/specify_cli/__init__.py
Comment thread src/specify_cli/__init__.py Outdated
Comment thread src/specify_cli/integration_status.py
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot's findings

  • Files reviewed: 5/5 changed files
  • Comments generated: 2

Comment thread src/specify_cli/integration_status.py
Comment thread src/specify_cli/integration_status.py
Copy link
Copy Markdown
Collaborator

@mnriem mnriem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address Copilot feedback. If not applicable, please explain why

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot's findings

  • Files reviewed: 5/5 changed files
  • Comments generated: 2

Comment thread src/specify_cli/integration_status.py Outdated
suggestion="Run `specify integration install <key>` to install one.",
)
)
return _build_report(default_key, installed_keys, findings, {}, True)
Comment on lines +323 to +327
manifest_path = project_root / ".specify" / "integrations" / f"{key}.manifest.json"
if not manifest_path.exists():
findings.append(
_finding(
"error",
@mnriem
Copy link
Copy Markdown
Collaborator

mnriem commented May 27, 2026

Please address Copilot feedback

Copilot AI review requested due to automatic review settings May 27, 2026 20:52
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Comment thread src/specify_cli/integration_status.py Outdated
Comment thread src/specify_cli/integration_state.py
Comment thread tests/integrations/test_integration_subcommand.py Outdated
Comment thread tests/integrations/test_integration_subcommand.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Add specify integration status reporting command

3 participants